<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta content="telephone=no" name="format-detection" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable = no"/>
    <title>{$data.shop_name}-{$webseting.web_title}</title>
    <link href="__PUBLIC__/wap/css/rest.css"  rel="stylesheet">
    <link href="__PUBLIC__/wap/css/user.css"  rel="stylesheet">
    <link href="__PUBLIC__/wap/css/shopdetail.css"  rel="stylesheet">
</head>
<body style="font-family: 'Helvetica Neue',Helvetica,'microsoft yahei',Arial,sans-serif;">
    <header id="header" class="u-header clearfix">
        <div class="u-hd-left f-left">
            <a href="javascript:history.go(-1);" class="J_backToPrev"><span class="u-icon-px i-hd-back"></span></a>
        </div>
        <div class="u-hd-tit"><span>商铺信息</span></div>
    </header>
    <div class="shopImg" style="background: url({:U('wap/index/get_thumbs',array('w'=>320,'h'=>181))}?img={$data.background}) 0% 50% / 100% no-repeat;"></div>
    <div class="shop-text">
        <h1>{$data.shop_name}</h1>
        <p class="u-detail-pricebox clearfix">
            <span class="u-detail-price"><span>人均：</span>¥{$data.buy}</span>
            <span class="u-detail-discount">{$data['discount_consume']*10}折</span>
        </p>
        <ul class="u-detail-introduce clearfix" style="display:block;">
            <li><span class="u-indtit">地址：</span>{$data.addr}</li>
            <li><span class="u-indtit">电话：</span><a href="tel:{$data.link_no}">{$data.link_no}</a></li>
        </ul>
        <div class="shop-jhp">
            <p class="dc_tit">商家主营</p>
            <div class="dc_info clearfix">
                {$data.business}
            </div>
        </div>
        <div class="shop-jhp">
            <p class="dc_tit">商家介绍</p>
            <div class="dc_info clearfix">
                  {$data.member_desc}
            </div>
        </div>
    </div>
    <div id="cart1" class="cart-btns-fixed" style="display: table;">
        <div class="cart-btns-fixed-box">
            <a class="btn btn-buy" style="width:100px;" data="{$data.shop_id}" data-type='{$collect}' id="directorder"><if condition="$collect gt 0">取消收藏<else/>收藏店铺</if></a>
            <a href="{:U('Wap/Group/shopproduct',array('id'=>$data['shop_id']))}" class="btn btn-cart" style="width:140px;" id="add_cart">访问商品列表</a>
        </div>
    </div>
   <script src="__PUBLIC__/bootstrap/vendor/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
   $(function(){
     $("#directorder").click(function(){
        var _this=$(this);
         var shop_id=_this.attr('data');
          var type=_this.attr('data-type');
           $.ajax({ 
            url: "{:U('wap/shop/shop_collect')}",
            type:'post',
            data: {shop_id:shop_id},
            dataType: 'json',
            success: function(data){
              if(data.status==1){
                if(type>0){
                    layer.msg("取消成功",{icon:6})
                    _this.html('收藏店铺');
                    _this.attr('data-type',0)
                }else{
                    layer.msg("收藏成功",{icon:6})
                    _this.html('取消收藏');
                    _this.attr('data-type',1)
                }
              }else{
                layer.msg(data.error,{icon:5})
              }
            }
           });
     });

   }); 

</script> 
</body>
</html>